package com.huhu.controller;

import com.huhu.controller.base.BaseController;
import com.huhu.dto.Result;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by xuyi on 2016/9/19.
 */

@Controller
@RequestMapping("shiroAopAuth")
public class ShiroAopAuth extends BaseController {
    //@RequiresRoles(value = {"admin","normal"}, logical = Logical.OR)
    //@RequiresAuthentication
    //@RequiresUser
    @RequiresAuthentication
    @RequestMapping("testShiroAop")
    @ResponseBody
    public Result testShiroAop() {
        Result rst = new Result();
        rst.setFlag(1);
        rst.setContent("测试注解权限控制成功！");

        return rst;
    }


}
